package Chapter7;
import java.util.*;
public class Example06 {
	public static void main(String[] args) {
		ArrayList list=new ArrayList();
		list.add("jack");
		list.add("annie");
		list.add("rose");
		list.add("tom");
		Iterator it=list.iterator();
		while(it.hasNext()) {
			Object obj=it.next();
			if("annie".equals(obj)) {
				it.remove();
			}
		}
		System.out.println(list);
	}

}
